package com.demo.strategy.youhui;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * @Author likz
 * @Date 2025/7/24 15:52
 * @Description
 **/
public class PromotionStrategyFactory {

    private static Map<String,IPromotionStrategy> map = new HashMap<>();

    static {
        map.put(PromotionKey.GROUP_BUY,new GroupBuyStrategy());
        map.put(PromotionKey.COUPON,new CouponStrategy());
        map.put(PromotionKey.CASHBACK,new CashbackStrategy());
    }
    private static  final IPromotionStrategy EMPTY=new EmptyStrategy() ;

    private PromotionStrategyFactory(){};
    public static IPromotionStrategy getPromotionStrategy(String promotionKey)
    {
        IPromotionStrategy promotionStrategy = map.get(promotionKey);
        return promotionStrategy;
    }


    public static Set<String> getPromotionKeys()
    {
        return map.keySet();
    }

}
